package com.qf.cx.simplenms.webservice.model;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import com.google.gson.Gson;

public class ReadersToJson {
	public static void main(String[] args) {
		generateReaders();

	}

	private static void generateReaders() {
		Gson gson = new Gson();
		List<Reader> readers = new ArrayList<>();

		for (int i = 0; i < 50; i++) {
			Reader t = new Reader();
			t.setName("reader" + i);
			String sn = String.format("%016d", i);
			t.setDeviceSn(sn);

			t.setIp("192.168.1.2");
			t.setPort(5000 + i);
			t.setLinkType(0);
			Set<Antenna> antennas = new HashSet<>();
			for (int j = 1; j <= 4; j++) {
				Antenna ant = new Antenna();
				ant.setAntenna(j);
				ant.setProtocol(2);
				antennas.add(ant);
			}
			t.setAntennas(antennas);

			readers.add(t);
		}

		System.out.println(gson.toJson(readers));
	}
}
